require 'time'
require 'parseconfig'
require 'openssl'
require 'tlsmail'

def send_mail(port, website, status)
	email_config = ParseConfig.new('login.conf').params
	from = email_config['from_address']
	to = email_config['to_address']
	p = email_config['p']
	

content = <<EOF
From: #{from}
To: #{to}
subject: status of Service: 
Date: #{Time.now.rfc2822}

Connectign to #{website} on #{port}
status #{status}

EOF
print 'content', content

Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
Net::SMTP.start('smtp.gmail.com', 587, 'gmail.com', from, p, :login) do |smtp|
	smtp.send_message(content, from, to)
	end
end


